﻿#ifndef XQPUSHREPLY_H
#define XQPUSHREPLY_H
#include"XQHead.h"
#include"XQHttpReplyObject.h"
#include"XQPushUser.h"
#include<QJsonDocument>
#include<QHash>
#include<QReadWriteLock>
class XQHttpReplyAccount;
//推送的服务器响应
class XQPushReply:public XQHttpReplyObject
{
	Q_OBJECT
public:
	XQPushReply(QObject* parent = nullptr);
public:
	void setAccountManagement(XQHttpReplyAccount* account);
	void setAppMysql(XQMySql* mysql);
	void setMail(XQMail*mail);
protected:
	//是否接受
	bool isAccepted(XQHttpHeadObject* head) const override;
	//回复
	XQHttpHeadReply reply(QIODevice* socket, XQHttpHeadRequest* header)override;
	//缓存处理
	void buffer(QIODevice* socket, XQHttpHeadObject* head, const QByteArray& buffer)override;

protected://业务处理
	
protected:
	XQMySql* m_appMysql = nullptr;
	XQMail* m_mail = nullptr;
	XQHttpReplyAccount* m_account = nullptr;
};
#endif // !XQPushResponse_H
